import { Button } from 'antd-mobile';
import { useDispatch, useSelector } from 'react-redux';
import { updateTheme } from '../../store/slice/theme';
import { RootState } from '../../store/store';

const PersonalCenter = () => {
    const theme = useSelector((state: RootState) => state.theme.value)
    const dispatch = useDispatch()

    const handleTheme = () => {
        dispatch(updateTheme(theme === 'light' ? 'dark' : 'light'))
    }
    return (
        <div>
            personalCenter
            <Button onClick={handleTheme}>点击切换</Button>
        </div>
    );
};

export default PersonalCenter;